<?php

class Country_controller extends CI_Controller {
            
    function __construct(){
        parent::__construct();
        $this->load->library('session');
        $this->load->helper('url');
        $this->load->helper('utils');
                            
        Validator::is_access($this->session->userdata('user_id'));
    }

    function index(){

        $section = "country";
        $title = _LB_COUNTRY;
        $cfer = new Cfer(array(
        $title => base_url('country')));
        
        $filter = array();
        $filter['name'] = $this->input->post('name');
        $country = Country::getList($filter);

        $this->data['country'] = $country;
        $this->data['filter'] = $filter;
        $this->data['title'] = $title;
        
        $pager = new Pager(base_url('country'));
        $this->data['paging'] = $pager->create_links();
        
        $array_menus = array();
        
        $filter = array();
        $filter['parent_id'] = 0;
        $filter['type'] = 1;
        Menu::getMenuList($array_menus, $filter);
        $this->data['cfer'] = $cfer;
        $this->data['array_menus'] = $array_menus;
        $this->data['section'] = $section;
        $this->data['cfer'] = $cfer;
        $this->load->view('country_list', $this->data);
    }
}
